<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>媒体查询 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    
    <link rel="prev" href="../dingwei/固定定位.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.22"
        data-chapter-title="媒体查询"
        data-filepath="CSS/mediatype.md"
        data-basepath=".."
        data-revision="Fri Sep 01 2017 14:19:43 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="html/HTML.html">
            
                
                    <a href="../html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="html/html标签.html">
            
                
                    <a href="../html/html标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        hmtl标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="html/table.html">
            
                
                    <a href="../html/table.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        table
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="html/forms.html">
            
                
                    <a href="../html/forms.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        form
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="html/type.html">
            
                
                    <a href="../html/type.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        type
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="html/实体字符.html">
            
                
                    <a href="../html/实体字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="html/图像.html">
            
                
                    <a href="../html/图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="html/icon.iframe.html">
            
                
                    <a href="../html/icon.iframe.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        icon iiframe base
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="html/H5的语义化标签.html">
            
                
                    <a href="../html/H5的语义化标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        H5的语义化标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="html/图片的热区域.html">
            
                
                    <a href="../html/图片的热区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        图片热区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="html/锚点.html">
            
                
                    <a href="../html/锚点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        锚点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="html/video.html">
            
                
                    <a href="../html/video.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.11.</b>
                        
                        video
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="html/audio.html">
            
                
                    <a href="../html/audio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.12.</b>
                        
                        audio
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS/css.html">
            
                
                    <a href="../CSS/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS/CSS选择器.html">
            
                
                    <a href="../CSS/CSS选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="CSS/关系选择器.html">
            
                
                    <a href="../CSS/关系选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="CSS/群组选择器.html">
            
                
                    <a href="../CSS/群组选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        群组选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="CSS/通配选择器.html">
            
                
                    <a href="../CSS/通配选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        通配选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="CSS/元素选择器.html">
            
                
                    <a href="../CSS/元素选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="CSS/元素样式.html">
            
                
                    <a href="../CSS/元素样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        元素样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="CSS/伪类选择器.html">
            
                
                    <a href="../CSS/伪类选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="CSS/伪对象选择器.html">
            
                
                    <a href="../CSS/伪对象选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        伪对象选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="CSS/属性选择器.html">
            
                
                    <a href="../CSS/属性选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="CSS/font.html">
            
                
                    <a href="../CSS/font.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="CSS/嵌入字体.html">
            
                
                    <a href="../CSS/嵌入字体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        嵌入字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="CSS/边框样式.html">
            
                
                    <a href="../CSS/边框样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        边框样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="CSS/内边距.html">
            
                
                    <a href="../CSS/内边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        内边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="CSS/外边距.html">
            
                
                    <a href="../CSS/外边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        外边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="CSS/圆角效果.html">
            
                
                    <a href="../CSS/圆角效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        圆角效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="CSS/透明度.html">
            
                
                    <a href="../CSS/透明度.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        透明度
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="CSS/段落控制.html">
            
                
                    <a href="../CSS/段落控制.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        段落控制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="CSS/三角形.html">
            
                
                    <a href="../CSS/三角形.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        三角形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="dingwei/绝对定位.html">
            
                
                    <a href="../dingwei/绝对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        绝对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="dingwei/相对定位.html">
            
                
                    <a href="../dingwei/相对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        相对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.21" data-path="dingwei/固定定位.html">
            
                
                    <a href="../dingwei/固定定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.21.</b>
                        
                        固定定位
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.22" data-path="CSS/mediatype.html">
            
                
                    <a href="../CSS/mediatype.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.22.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="media-type-&#x5A92;&#x4F53;&#x7C7B;&#x578B;">media type &#x5A92;&#x4F53;&#x7C7B;&#x578B;</h2>
<h3 id="&#x6240;&#x7528;&#x5230;&#x7684;&#x4EE3;&#x7801;&#x7C7B;&#x578B;">&#x6240;&#x7528;&#x5230;&#x7684;&#x4EE3;&#x7801;&#x7C7B;&#x578B;</h3>
<table>
<thead>
<tr>
<th>&#x4EE3;&#x7801;</th>
<th>&#x5A92;&#x4F53;&#x7C7B;&#x578B;</th>
</tr>
</thead>
<tbody>
<tr>
<td>all</td>
<td>&#x5168;&#x90E8;&#x5A92;&#x4F53;&#x7C7B;&#x578B;</td>
</tr>
<tr>
<td>braille</td>
<td>&#x76F2;&#x6587;&#x89E6;&#x6478;&#x88C5;&#x7F6E;</td>
</tr>
<tr>
<td>embossed</td>
<td>&#x5206;&#x9875;&#x76F2;&#x6587;&#x6253;&#x5370;&#x673A;</td>
</tr>
<tr>
<td>handheld</td>
<td>&#x5C0F;&#x5C4F;&#x5E55;&#x548C;&#x6D41;&#x91CF;&#x6709;&#x9650;&#x7684;&#x624B;&#x6301;&#x8BBE;&#x5907;</td>
</tr>
<tr>
<td>print</td>
<td>&#x63D0;&#x4F9B;&#x7ED9;&#x6253;&#x5370;&#x673A;&#x7684;&#x6837;&#x5F0F;</td>
</tr>
<tr>
<td>projection</td>
<td>&#x7ED9;&#x6295;&#x5F71;&#x673A;&#x4F7F;&#x7528;&#x7684;</td>
</tr>
<tr>
<td>screen</td>
<td>PC&#x5C4F;&#x5E55;&#x6216;&#x8005;&#x5B89;&#x5353;&#x7CFB;&#x7EDF;&#x624B;&#x673A;&#x5C4F;&#x5E55;&#xFF0C;&#x4E00;&#x822C;&#x548C;&#x5C4F;&#x5E55;&#x5927;&#x5C0F;&#x8054;&#x5408;&#x4F7F;&#x7528;</td>
</tr>
<tr>
<td>speech</td>
<td>&#x8BED;&#x97F3;&#x6717;&#x8BF5;</td>
</tr>
<tr>
<td>tty</td>
<td>&#x56FA;&#x5B9A;&#x95F4;&#x8DDD;&#x5B57;&#x7B26;&#x7F51;&#x683C;&#xFF0C;&#x4F8B;&#x5982;&#x529F;&#x80FD;&#x673A;</td>
</tr>
<tr>
<td>TV</td>
<td>&#x667A;&#x80FD;&#x7535;&#x89C6;&#x8BBE;&#x5907;</td>
</tr>
</tbody>
</table>
<p>&#x9ED8;&#x8BA4;&#x7684;&#x5C5E;&#x6027;&#x662F;all</p>
<h3 id="media-type&#x7684;&#x5E38;&#x7528;&#x51E0;&#x4E2A;&#x65B9;&#x6CD5;">media type&#x7684;&#x5E38;&#x7528;&#x51E0;&#x4E2A;&#x65B9;&#x6CD5;</h3>
<p>1.&#x5728;<head>&#x4E2D;&#x95F4;&#x8FDE;&#x63A5;&#x8FDB;&#x53BB;&#xFF0C;&#x9009;&#x62E9;&#x52A0;&#x8F7D;&#x4E0D;&#x540C;&#x7684;css&#x6587;&#x4EF6;</head></p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;middle.css&quot; media=&quot;screen and (min-width: 400px)&quot;&gt;
</code></pre><p>&#x5176;&#x610F;&#x601D;&#x662F;&#x6EE1;&#x8DB3;media &#x7684;&#x5224;&#x65AD;&#x8BED;&#x53E5; screen and (min-width: 400px) &#x5373; &#x5C4F;&#x5E55;&#x5E76;&#x4E14;&#x6700;&#x5C0F;&#x5BBD;&#x5EA6;&#x4E0D;&#x5C0F;&#x4E8E;400px &#x7684;&#x4ECB;&#x8D28;&#x4E0A;&#x9762;&#x4F7F;&#x7528; middle.css</p>
<p>2.&#x662F;@media&#x6CD5;&#xFF0C;&#x662F;&#x5728;&#x4E0D;&#x540C;&#x7684;css&#x6587;&#x4EF6;&#x63D2;&#x5165;&#x4E0D;&#x540C;&#x7684;&#x6761;&#x4EF6;&#xFF0C;&#x4F46;&#x662F;&#x548C;css&#x4E00;&#x6837;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x540C;&#x4E00;&#x79CD;&#x5C5E;&#x6027;&#xFF0C;&#x540E;&#x9762;&#x7684;&#x4F1A;&#x8986;&#x76D6;&#x524D;&#x9762;&#x7684;&#x3002;</p>
<pre><code>/* CSS Code */  
@media screen and (min-width: 600px) { /* CSS Code */ }  
@media screen and (max-width: 599px) { /* CSS Code */ }
</code></pre><h4 id="&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x4EE3;&#x7801;">&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x4EE3;&#x7801;</h4>
<table>
<thead>
<tr>
<th>&#x4EE3;&#x7801;</th>
<th>&#x610F;&#x601D;</th>
</tr>
</thead>
<tbody>
<tr>
<td>width-viewport</td>
<td>&#x5BBD;&#x5EA6;&#xFF0C;&#x80FD;&#x8BBE;&#x5B9A;&#x6700;&#x5927;&#x503C;&#x548C;&#x6700;&#x5C0F;&#x503C;&#xFF0C;&#x8981;&#x5728;&#x524D;&#x9762;&#x52A0;max-&#x6216;&#x8005;min-</td>
</tr>
<tr>
<td>height-viewport</td>
<td>&#x9AD8;&#x5EA6;&#xFF0C;&#x548C;&#x5BBD;&#x5EA6;&#x4E00;&#x6837;&#x80FD;&#x8BBE;&#x7F6E;&#x6700;&#x5927;&#x503C;&#x548C;&#x6700;&#x5C0F;&#x503C;</td>
</tr>
<tr>
<td>initial-scale</td>
<td>&#x521D;&#x59CB;&#x7684;&#x7F29;&#x653E;&#x6BD4;&#x4F8B;</td>
</tr>
<tr>
<td>minimum-scale</td>
<td>&#x5141;&#x8BB8;&#x7528;&#x6237;&#x7F29;&#x653E;&#x5230;&#x6700;&#x5C0F;&#x6BD4;&#x4F8B;</td>
</tr>
<tr>
<td>maximum-scale</td>
<td>&#x5141;&#x8BB8;&#x7528;&#x6237;&#x7F29;&#x653E;&#x5230;&#x6700;&#x5927;&#x6BD4;&#x4F8B;</td>
</tr>
<tr>
<td>user-scalabel</td>
<td>&#x7528;&#x6237;&#x662F;&#x5426;&#x53EF;&#x4EE5;&#x624B;&#x52A8;&#x7F29;&#x653E;</td>
</tr>
</tbody>
</table>
<p>&#x7528;&#x4F8B;&#xFF1A;&#x5B9A;&#x4E49;&#x89C6;&#x53E3;&#x7684;&#x5BBD;&#x4E3A;&#x8BBE;&#x5907;&#x5BBD;&#xFF0C;&#x521D;&#x59CB;&#x7F29;&#x653E;&#x4E3A;1&#x500D;&#xFF0C;&#x6700;&#x5927;&#x548C;&#x6700;&#x5C0F;&#x7F29;&#x653E;&#x500D;&#x6570;&#x4E3A;1&#xFF0C;&#x7981;&#x6B62;&#x7528;&#x6237;&#x7F29;&#x653E;</p>
<pre><code>meta name=&#x201D;viewport&#x201D; content=&#x201D;width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1,user-scalable=0&#x2033;
</code></pre><blockquote>
<p>&#x53EF;&#x4EE5;&#x7528;and&#x8868;&#x793A;&#x540C;&#x65F6;&#x6EE1;&#x8DB3;&#x8FD9;&#x4E24;&#x4E2A;&#x6761;&#x4EF6;&#x65F6;&#x5019;&#x624D;&#x751F;&#x6548;&#xFF0C;&#x8FBE;&#x5230;&#x9650;&#x5B9A;&#x8303;&#x56F4;&#xFF1A;  </p>
</blockquote>
<pre><code> media=&quot; handheld and (min-width:20em) and (max-width:50em)&quot;
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../dingwei/固定定位.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 固定定位"><i class="fa fa-angle-left"></i></a>
        
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
